package com.hycc.base;

import java.util.function.Function;

public class FunctionDemo {
    public static void main(String[] args) {
        Function<String, Integer> f = new Function<String,Integer>(){
            @Override
            public Integer apply(String s) {
                return 1;
            }
        };
        System.out.println(f.apply("abc"));

        Function<String, Float> ff =(str)->{return Float.valueOf(str.hashCode());};
        System.out.println(ff.apply("cvb"));
    }
}
